/*!-----------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * monaco-languages version: 1.7.0(06ba3ff7e80720fda9a83bce89dbe13ed389b69e)
 * Released under the MIT license
 * https://github.com/Microsoft/monaco-languages/blob/master/LICENSE.md
 *-----------------------------------------------------------------------------*/
define(
    "vs/basic-languages/cpp/cpp",
    ["require","exports"],
    function(e,n){
        "use strict";
        Object.defineProperty(n,"__esModule",{value:!0});
        var t="undefined"==typeof monaco?self.monaco:monaco;
        n.conf={
            comments:{
                lineComment:"//",
                blockComment:["/*","*/"]
            },
            brackets:[["{","}"],["[","]"],["(",")"]],
            autoClosingPairs:[
                {open:"{",close:"}"},
                {open:"[",close:"]"},
                {open:"(",close:")"},
                {open:'"',close:'"',notIn:["string"]},
                {open:"'",close:"'",notIn:["string","comment"]}
            ],
            surroundingPairs:[
                {open:"{",close:"}"},
                {open:"[",close:"]"},
                {open:"(",close:")"},
                {open:'"',close:'"'},
                {open:"'",close:"'"}
            ],
            onEnterRules:[
                {
                    beforeText:new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$"),
                    action:{
                        indentAction:t.languages.IndentAction
                    }
                }
            ],
            folding:{
                offSide:!0,
                markers:{
                    start:new RegExp("^\\s*#region\\b"),
                    end:new RegExp("^\\s*#endregion\\b")
                }
            }
        },
        n.language={
            defaultToken:"",
            tokenPostfix:".cpp",
            keywords:[
                "asm",
                "auto",
                "bool",
                "break",
                "case",
                "catch",
                "char",
                "class",
                "const",
                "const_cast",
                "continue",
                "default",
                "delete",
                "do",
                "double",
                "dynamic_cast",
                "else",
                "enum",
                "explicit",
                "export",
                "extern",
                "false",
                "float",
                "for",
                "friend",
                "goto",
                "if",
                "inline",
                "int",
                "long",
                "mutable",
                "namespace",
                "new",
                "operator",
                "private",
                "protected",
                "public",
                "register",
                "reinterpret_cast",
                "return",
                "short",
                "signed",
                "sizeof",
                "static",
                "static_cast",
                "struct",
                "switch",
                "template",
                "this",
                "throw",
                "true",
                "try",
                "typedef",
                "typeid",
                "typename",
                "union",
                "unsigned",
                "using",
                "virtual",
                "void",
                "volatile",
                "wchar_t",
                "while",
                "uint8_t",
                "uint16_t",
                "uint32_t",
                "int8_t",
                "int16_t",
                "int32_t"
            ],
            brackets:[
                {
                    open:"{",
                    close:"}",
                    token:"delimiter.curly"
                },
                {
                    open:"[",
                    close:"]",
                    token:"delimiter.bracket"
                },
                {
                    open:"(",
                    close:")",
                    token:"delimiter.parenthesis"
                }
            ],
            tokenizer:{
                root:[
                    {include:"@whitespace"},
                    {include:"@numbers"},
                    {include:"@strings"},
                    [/[,:;]/,"delimiter"],
                    [/[{}\[\]()]/,"@brackets"],
                    [/@[a-zA-Z]\w*/,"tag"],
                    [/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@default":"identifier"}}],
                    // 多行注释的开始和结束
                    [/\/*/, { token: 'comment', next: '@comment' }],
                    // 将 # 与注释分开
                    [/#[^\n]*/, { token: 'keyword' }],
                    // 其他关键字和符号
                    [/\b(if|else|while|for)\b/, { token: 'keyword' }],
                    [/[{}()\[\]]/, { token: 'delimiter' }],
                    [/[=+\-*\/%<>!&|]/, { token: 'operator' }],
                    // 数字和字符串
                    [/\d+/, { token: 'number' }],
                    [/"([^"\\]|\\.)*$/, { token: 'string.invalid' }],
                    [/"/, { token: 'string.quote', next: '@string' }],
                ],
                comment: [
                    // 多行注释的结束
                    [/.*?\*\//, { token: 'comment', next: '@pop' }],
                    [/./, 'comment'],
                ],
                string: [
                    [/[^\\"]+/, 'string'],
                    [/\\./, 'string.escape.invalid'],
                    [/"/, { token: 'string.quote', next: '@pop' }],
                ],
                whitespace:[
                    [/\s+/,"white"],
                    [/(^\/\/.*$)/,"comment"],
                    [/'''/,"string","@endDocString"],
                    [/"""/,"string","@endDblDocString"]
                ],
                
                endDocString:[
                    [/[^']+/,"string"],
                    [/\\'/,"string"],
                    [/'''/,"string","@popall"],
                    [/'/,"string"]
                ],
                endDblDocString:[
                    [/[^"]+/,"string"],
                    [/\\"/,"string"],
                    [/"""/,"string","@popall"],
                    [/"/,"string"]
                ],
                numbers:[
                    [/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/,"number.hex"],
                    [/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/,"number"]
                ],
                strings:[
                    [/'$/,"string.escape","@popall"],
                    [/'/,"string.escape","@stringBody"],
                    [/"$/,"string.escape","@popall"],
                    [/"/,"string.escape","@dblStringBody"]
                ],
                stringBody:[
                    [/[^\\']+$/,"string","@popall"],
                    [/[^\\']+/,"string"],
                    [/\\./,"string"],
                    [/'/,"string.escape","@popall"],
                    [/\\$/,"string"]
                ],
                dblStringBody:[
                    [/[^\\"]+$/,"string","@popall"],
                    [/[^\\"]+/,"string"],
                    [/\\./,"string"],
                    [/"/,"string.escape","@popall"],
                    [/\\$/,"string"]
                ]
            }
        }
    });